package cn.edu.zjicm.wordsnet_d.data;

public class BoardItem implements Comparable<BoardItem>{
	int rank;
	String element;
	int score;
	
	public BoardItem(String element, int score) {
		super();
		this.element = element;
		this.score = score;
	}
	
	public BoardItem(int rank, String element, int score) {
		super();
		this.rank = rank;
		this.element = element;
		this.score = score;
	}		
	
	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public String getElement() {
		return element;
	}
	
	public void setElement(String element) {
		this.element = element;
	}
	
	public int getScore() {
		return score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}	
	
	@Override  
    public int compareTo(BoardItem o) {  
		if(o.getScore() - score != 0)
			return o.getScore() - score;
		else 
			return o.getElement().compareTo(element);
    }  
}